  <?php if(!empty($id)) { ?>
 <form action="<?= $admin_base_url; ?>financialyear/edit/<?=$id;?>/<?php echo $cur_page;?>" method="post" id="financialyear_form">
 <?php } else { ?>
 <form action="<?= $admin_base_url; ?>financialyear/add/<?= $cur_page;?>" method="post" id="financialyear_form">
 <?php } ?>
 <br/>
<?php
$year   = date('Y');
$byear  =  $year-5;
$ayear  =  $year+5;
$arrMonth  = array(1=>"Jan",2=>"Feb",3=>"Mar",4=>"Apr",5=>"May",6=>"Jun",7=>"Jul",8=>"Aug",9=>"Sep",10=>"Oct",11=>"Nov",12=>"Dec");
 
?>

		<label>Financial year </label> 
        <select class="txt2" name="year1">
        <?php 
		for($byear;$byear< $ayear;$byear++)
		{
			echo "<option ";
			if($financialyear['year1']==$byear) echo "selected";
			echo " >". $byear."</option>" ;
		}
		?>
          </select>
          <select class="txt2" name="month1">
          <?php 
		  foreach($arrMonth as $m=>$M)
		  {
			  echo "<option ";
			  if($financialyear['month1']==$m) echo "selected";
			  echo " value='".$m."'>" . $M."</option>";
		  }
		  
		  ?>
          
          </select> To
   <?php
   $byear  =  $year-5;
$ayear  =  $year+5;
   ?>       
          <select class="txt2" name="year2">
        <?php 
		for($byear;$byear< $ayear;$byear++)
		{
			echo "<option ";
			if($financialyear['year2']==$byear) echo "selected";
			echo " >". $byear."</option>" ;
		}
		?>
          </select>
          <select class="txt2" name="month2">
          <?php 
		  foreach($arrMonth as $m=>$M)
		  {
			  echo "<option ";
			  if($financialyear['month2']==$m) echo "selected ";
			  echo "value='".$m."'>" . $M."</option>";
		  }
		  
		  ?>
          
          </select>
		<?php /*<input class="txt1" type="text" name="name" value="<?php echo $financialyear['name'];?>" /> */ ?>
	
	
		&nbsp;
	    
			<div class="buttons">
			    <button type="submit" name="save" class="positive" value="save" >
			        <img src="<?php echo $admin_image_path?>icons/apply.png" alt=""/>
			          <?php if(!empty($id)) { ?>
 							Update Financial year
 							<input type="hidden" name="id" value="<?php echo $id;?>" />
                       
 							<input  type="hidden" name="rurl" value="<?php echo $rurl;?>" />
 					  <?php } else { ?>
 					  	Add Financial year
 					  	<?php } ?>

 			    </button>
			   <a href="<?= $admin_base_url; ?>financialyear/cancel?rurl=<?php echo $rurl;?>" class="negative">
			        <img src="<?php echo $admin_image_path?>icons/cross.png" alt=""/>
			        Cancel
			   </a>
			</div>
	
	

 </form>
 <script>
 $(document).ready(function() {
     $("#financialyear_form").RSV({
       onCompleteHandler: frmSubmit,
       errorFieldClass: "errorDesc",
       displayType: "display-html",
       errorHTMLItemBullet: "&#8212; ",
             rules: [
                     "required,name,Please enter name."
             ]
     });
  // a custom onComplete handler to prevent form submits for the demo
     function frmSubmit()
     {
       return true;
     }

        
});
 </script>